//
//  Fresnel.hpp
//  RayTracer
//
//  Created by 俞云康 on 3/25/16.
//  Copyright © 2016 yushroom. All rights reserved.
//

#ifndef Fresnel_hpp
#define Fresnel_hpp

#include "Math.hpp"
#include "Color.hpp"

class Fresnel {
public:
    Fresnel() = default;
    virtual ~Fresnel() = default;
    virtual Color Evaluate(float cos_i) const = 0;
};

class FresnelDialectric : public Fresnel {
private:
    float eta_i;    // index of refraction of incident media
    float eta_t;    // ...                    transmitted media
public:
    
    FresnelDialectric(float eta_i, float eta_t) : eta_i(eta_i), eta_t(eta_t) {}
    
    virtual Color Evaluate(float cos_i) const override;
};

class FresnelConductor : public Fresnel {
private:
    Color eta, k;
public:
    FresnelConductor(Color eta, Color k) : eta(eta), k(k) {}
    virtual Color Evaluate(float cos_i) const override;
};

class FresnelNoOp : public Fresnel {
public:
    FresnelNoOp() = default;
    virtual Color Evaluate(float cos_i) const override {
        return Color(1, 1, 1);
    }
};



#endif /* Fresnel_hpp */
